home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 90 / CD Actual 90.iso / Software3D / K-3D / k3d-0.4.2.1 / shaders / k3d_painted_constant.sl < prev    next >
Encoding:
Text File  |  2004-07-23  |  423 b   |  25 lines

  1. surface k3d_painted_constant(
  2.     string texturename = "";
  3.     float s0 = 0.0;
  4.     float s1 = 1.0;
  5.     float t0 = 0.0;
  6.     float t1 = 1.0;
  7.     )
  8. {
  9.     color Ct = color(1, 1, 1);
  10.     float Ot = 1;
  11.     
  12.     if(texturename != "")
  13.         {
  14.             float ss = mix(s0, s1, s);
  15.             float tt = mix(t0, t1, t);
  16.             
  17.             Ct = color texture(texturename, ss, tt);
  18.             Ot = float texture(texturename[3], ss, tt);
  19.         }
  20.  
  21.     Oi = Os * Ot;
  22.     Ci = Oi * Cs * Ct;
  23. }
  24.  
  25.